﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace WRJClient.Common
{
    public sealed class UpdateManager : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }


        private int _count = 0;

        private static readonly UpdateManager _instance = new UpdateManager();
        public static UpdateManager Instance { get { return _instance; } }
        private UpdateManager() { }

        public bool HasCount
        {
            get
            {
                if (_count == 0)
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
        }
        public void Count()
        {
            _count++;
            OnPropertyChanged("HasCount");
        }

        public void Reset()
        {
            _count = 0;
            OnPropertyChanged("HasCount");
        }



    }
}
